import string,secrets

def gen_int(length:int = 5) -> str:
    """
    生成指定长度的纯数字字符串
    :param length: 字符长度
    :return:
    """
    characters = string.digits
    ret = "".join(secrets.choice(characters) for i in range(length))
    return ret

if __name__ == '__main__':
    print(gen_int(5))
